package com.beordie.dao;

import com.beordie.model.Police;
import com.beordie.model.Punishment;

import java.util.List;

/**
 * @Classname
 * @Description TODO
 * @Date 2021/7/13 17:16
 * @Created 30500
 */
public interface IPunishmentDao {
    String SQL_SELECT_ALL = "SELECT * FROM PUNISHMENT";
    String SQL_SELECT_ALL_BY_LIMIT = "SELECT * FROM PUNISHMENT LIMIT ? , ?";
    String SQL_INSERT_ONE = "INSERT INTO PUNISHMENT VALUES(NULL,?,?)";
    String SQL_DELETE_BY_ID = "DELETE FROM PUNISHMENT WHERE ID = ?";
    String SQL_UPDATE_BY_ID = "UPDATE PUNISHMENT SET NUMBER = ?, PUNISHMENT = ? WHERE ID = ?";
    String SQL_SELECT_BY_NUMBER = "SELECT * FROM PUNISHMENT WHERE NUMBER = ?";
    String SQL_SELECT_COUNT = "SELECT COUNT(1) FROM PUNISHMENT";
    String SQL_SELECT_BY_NOTICE = "SELECT * FROM punishment p, middle m WHERE m.punishmentID = p.id AND m.noticeid = ?";

    public List<Punishment> getAll();
    public List<Punishment> getAllByNotice(int id);
    public List<Punishment> getAllByLimit(boolean isLimit, int start, int size);
    public int insert(Punishment punishment);
    public int deleteById(int id);
    public int updateById(Punishment punishment, int id);
    public Punishment findByNumName(String condition);
    public int getCount();
}
